﻿using System;

namespace Scrabble.Model
{
    public class RandomNumberSeries : IRandomNumberSeries
    {
        private int _seed;
        private Random _series;

        public RandomNumberSeries() : this(new Random().Next())
        {
        }

        public RandomNumberSeries(int seed) 
        {
            Seed = seed;
        }

        public int Seed
        {
            get { return _seed; }
            set { _seed = value; _series = new Random(Seed); }
        }

        public int Next(int maximumValue)
        {
            return _series.Next(maximumValue);
        }
    }
}